package mygameserver;

import java.net.Socket;

public class Player implements Observer{

    private String pName;
    private Socket cSocket;
    private int pHashCode;

    public Player(Socket cSocket, String name) {
        this.cSocket = cSocket;
        this.pHashCode = cSocket.hashCode();
        this.pName = name;
    }

    public Socket getcSocket() {
        return cSocket;
    }

    public String getpName() {
        return pName;
    }

    public void setpName(String pName) {
        this.pName = pName;
    }

    public int getpHashCode() {
        return pHashCode;
    }

    @Override
    public void update(String command) {
        ServerThread.server.sendMessageTo(cSocket, command);
    }
}
